From 499f972752289a12282e14e6846fcb4cd0e6642e Mon Sep 17 00:00:00 2001 From: Sam Reed Date: Tue, 25 May 2010 18:37:55 +0000 Subject: [PATCH] Followup to r66873 If title valid, append URL to parse output --- includes/api/ApiParse.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/includes/api/ApiParse.php b/includes/api/ApiParse.php index 7a37a320d0..677f60c673 100644 --- a/includes/api/ApiParse.php +++ b/includes/api/ApiParse.php @@ -322,7 +322,13 @@ class ApiParse extends ApiBase { foreach ( $titles as $title => $id ) { $entry = array(); $entry['prefix'] = $prefix; - $this->getResult()->setContent( $entry, Title::makeTitle( $ns, $title )->getFullText() ); + + $title = Title::newFromText( "{$prefix}:{$title}" ); + if ( $title ) { + $entry['url'] = $title->getFullURL(); + } + + $this->getResult()->setContent( $entry, $title->getFullText() ); $result[] = $entry; } } -- 2.20.1